package com.zxw.common.core.base.bean;

import com.zxw.common.core.base.enums.FlowEnum;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author Xuewei.Zhang
 * @date 2022/7/5
 */
@Configuration
public class FlowBean {

    @Bean("FlowEnumBean")
    public Map<String, Integer> FlowEnumBean() {
        Map<String, Integer> map = new ConcurrentHashMap<>();
        for (FlowEnum flowEnum : FlowEnum.values()) {
            map.put(flowEnum.getMsg(), flowEnum.getCode());
        }
        return map;
    }
}
